import java.util.Arrays;
import java.util.Scanner;

public class Main1242 {

    public static void main(String[] args){
        Scanner sc=new Scanner(System.in);
        int n=sc.nextInt();
        int k=sc.nextInt();
        int[] array=new int[n];
        for (int i=0;i< array.length;i++){
            array[i]=sc.nextInt();
        }
        //排序
        Arrays.sort(array);

        for (int i=0;i< array.length;i++){
            System.out.print(array[i]+" ");
        }
//        System.out.println("sorted Array ::"+Arrays.toString(array));

      int size = array.length;

      int res = array[size-2];
      //        System.out.println("2nd largest element is ::"+res);
      int res1= array[1];
      int m=res-res1;
      boolean flag = true;
      for (int i=2;i<m;i++){
            if (m%i==0){
                flag=false;
//                   System.out.println("NO");
                break;
            }
//              else {
//                System.out.println("YES1");
//            }
        }
      if (flag){
          System.out.println("YES");
      }
      else {
          System.out.println("NO");
      }
        System.out.println(m);
    }
}
